package com.qf.fmall01.controller;

import com.qf.fmall01.entity.Orders;
import com.qf.fmall01.service.OrderService;
import com.qf.fmall01.vo.ResultVO;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("order")
@CrossOrigin
@Api(value = "订单接口",tags = "处理订单业务")
public class OrderController {

    @Autowired
    private OrderService orderService;

    @RequestMapping(value = "add",method = RequestMethod.POST)
    public ResultVO addOrder(String cids, @RequestBody Orders order){
        return orderService.addOrder(cids,order);
    }

    @RequestMapping(value = "status/{orderId}",method = RequestMethod.GET)
    public ResultVO queryOrderStatus(@PathVariable("orderId") String orderId){
        return orderService.queryOrderStatus(orderId);
    }

}
